package com.acme.task6;

public class Text6 {

	public String RemovSubstr(String str) {
		int length = str.length();
		int substr = str.indexOf("//");
		if (substr == -1) { // Substring "//" is not found

			return str;

		} else {
			String s = str.substring(substr, length);
			String s2 = str.replaceAll(s, "");
			return s2;
		}
	}

	public String[] RemovString(String[] str) {
		
		int length = str.length;
		boolean flag = false;
		for (int i = 0; i < length; i++) {
			String s1 = RemovSubstr(str[i]);
			str[i] = s1;
			int substr = str[i].indexOf("/*");
			if (flag) {
				substr = str[i].indexOf("*/");
				if (substr == -1) {
					str[i] = "";
					continue;
				} else {
					flag = false;
					String s = str[i].substring(0, substr);
					
					
					String s2 = str[i].replaceAll(s, "");
					str[i] = s2;
					continue;
				}
			} else {

				if (substr == -1) {
					continue;
				} else {
					flag = true;
					String s = str[i].substring(substr, str[i].length());
					
					String s2 = str[i].replaceAll(s, "");
					str[i] = s2;
					
				}

			}
		}

		return str;
	}

	public static void main(String[] args) {
        String[] str = new String[4];
        str[0] = " c /* m,m,m,m,nmbknbkb";
        str[1] = "jhjhjkhkjhkjh  */ ";
        str[2] = "ascfweffe // 12121";
        str[3] = "dddd //eeeeeeeeeeeeeeeeeeeeeeeeeee";
        
        Text6 t = new Text6();
        str = t.RemovString(str);
        for (int i = 0; i < str.length; i++) {
        System.out.println(str[i]); 
        }
        
	}
}
